Skip to content

Patch xdr and spec crates to support long type names - #2674

Closed
leighmcculloch wants to merge 5 commits into
mainfrom
patch-xdr-and-spec-crates
Closed

Patch xdr and spec crates to support long type names#2674
leighmcculloch wants to merge 5 commits into
mainfrom
patch-xdr-and-spec-crates

Conversation

@leighmcculloch

@leighmcculloch leighmcculloch commented Aug 7, 2026

Copy link
Copy Markdown
Member

Note

Part of a stack of PRs that must merge in this order.

A first group of PRs deliver const-encoded contract specs, so that contract specs are produced at compile time instead of at proc-macro execution time. This provides the foundation for the capability to construct the specs from information that is not known at proc-macro execution and only known at compile time, like the fully qualified name of a type:

  1. Add borrowed Ref variants of generated types rs-stellar-xdr#560
  2. Add const XDR serialization on View types rs-stellar-xdr#562
  3. Encode contract spec XDR at const evaluation time rs-soroban-sdk#1965

A second group of PRs deliver fully qualified type names in contract specs. Instead of a type having the name Context it will have the name soroban_sdk::auth::Context. Qualified type names make it possible to uniquely identify types in the spec, even when they have the same name. This resolves several problems with contract specs the type identify problem (stellar/rs-soroban-sdk#1570), type aliases limitations (stellar/rs-soroban-sdk#1857 stellar/rs-soroban-sdk#1063), and optimise spec shaking data section size (stellar/rs-soroban-sdk#1978):

  1. Widen user-defined type name limit stellar-xdr#312
  2. Regenerate with widened UDT name limit rs-stellar-xdr#566
  3. Qualify user-defined type names rs-soroban-sdk#1970
  4. Update stellar-xdr to 28.0.0 rs-stellar-rpc-client#108
  5. Patch xdr and spec crates to support long type names #2674 ← this PR
  6. Handle module-qualified contract type names js-stellar-sdk#1623

What

Patch stellar-xdr to stellar/rs-stellar-xdr#566, the soroban spec crates to stellar/rs-soroban-sdk#1970, and stellar-rpc-client to stellar/rs-stellar-rpc-client#108, moving the workspace to stellar-xdr 28 and soroban-env-host 28.0.1, and adapt the CLI to the widened user-defined type name limit and the new ScVal::ExecutableTag and ContractExecutable::ExternalRef variants.

Why

Contract specs are moving to fully qualified user-defined type names, which need the widened name limit those PRs deliver, and the CLI has to be able to read and print specs produced by them.

Known limitations

The network-backed suites (RPC Tests, bindings typescript, Ledger Emulator Tests) fail because the test contracts now build against protocol 28 while the quickstart image still runs an older host, which rejects them with "contract protocol number is newer than host"; they stay red until a protocol 28 quickstart exists. Merging also depends on all three upstream PRs landing and releasing, with the [patch.crates-io] git revisions replaced by published versions.

@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Aug 7, 2026
@leighmcculloch leighmcculloch changed the title Patch xdr and spec crates to pending PRs Patch xdr and spec crates to support long type names Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant